package com.darren.framework.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.ResultCheckStyle;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.Where;

@Entity
@Table(name = "d_cities")
@SQLDelete(sql = "update d_cities set is_delete = true where id=?", check = ResultCheckStyle.COUNT)
@Where(clause = "is_delete  = false")
public class City implements Serializable {

	private static final long serialVersionUID = 2861478466077717714L;

	@Id
	@Column(name = "id")
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;

	/**
	 * 城市编号
	 */
	@Column(name = "city_code",columnDefinition = "varchar(20) comment '城市编号'")
	private String cityCode;
	
	/**
	 * 城市名字
	 */
	@Column(name = "city_name",columnDefinition = "varchar(50) comment '城市名字'")
	private String cityName;
	
	/**
	 * 省份编号
	 */
	@Column(name = "province_code",columnDefinition = "varchar(20) comment '省份编号'")
	private String provinceCode;

	/**
     * 数据状态，是否删除：true是已删除；false 是未删除
     */
    @Column(name = "is_delete",columnDefinition = "bit default 0 comment '数据状态，是否删除：1 是已删除；0 是未删除'")
	private boolean delete = false;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCityCode() {
		return cityCode;
	}

	public void setCityCode(String cityCode) {
		this.cityCode = cityCode;
	}

	public String getCityName() {
		return cityName;
	}

	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	public String getProvinceCode() {
		return provinceCode;
	}

	public void setProvinceCode(String provinceCode) {
		this.provinceCode = provinceCode;
	}

	public boolean isDelete() {
		return delete;
	}

	public void setDelete(boolean delete) {
		this.delete = delete;
	}

}
